import cv2 as cv

img = cv.imread(r'D:\Documents\lena.jpg')
img1 = cv.imread(r'D:\Documents\lena.jpg')
img2 = cv.imread(r'D:\Documents\lena.jpg')
gray = cv.cvtColor(img,cv.COLOR_BGR2GRAY)
gray1 = cv.cvtColor(img1,cv.COLOR_BGR2GRAY)
gray2 = cv.cvtColor(img2,cv.COLOR_BGR2GRAY)

cv.imshow('source img',img)
cv.imshow('gray',gray)
cv.waitKey()

hsv = cv.cvtColor(img,cv.COLOR_BGR2HSV)

cv.imshow('Hue',hsv[:,:,0])
cv.imshow('Saturation',hsv[:,:,1])
cv.imshow('Value',hsv[:,:,2])
cv.waitKey()


img[:,:,1]=0
img[:,:,2]=0
cv.imshow('Blue',img)


img1[:,:,0]=0
img1[:,:,1]=0
cv.imshow('Green',img1)


img2[:,:,0]=0
img2[:,:,2]=0
cv.imshow('Red',img2)


cv.waitKey()
cv.destroyAllWindows()
